<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=7" />
        <title>后台管理中心</title>
        {$system_css}
        {$system_js}
    </head>
    <body>
        {include file="message.html"}
        <div class="pad-lr-10" style="margin-top: 15px;">
            <table width="100%" cellspacing="0" class="search-form">
                <tbody>
                    <tr>
                        <td>
                            <div class="explain-col">
                                <a class="add fb" href="{$site_url}admin/privilege/add/{$current_id}"><input type="button" name="search" class="button" value="添加权限" /></a> |  <a class="add fb" href="{$site_url}admin/privilege/createfile"><input type="button" name="search" class="button" value="生成缓存文件" /></a>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            <form name="myform" action="{$action}" method="post">
                <div class="table-list">
                    <table width="100%" cellspacing="0">
                        <thead>
                            <tr>
                                <th width="45">ID</th>
                                <th>权限名称</th>
                                <th width="120" >权限key</th>
                                <th>所属模块</th>
                                <th>管理操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach from=$privilege_list item=list}
                            <tr>
                                <td align="center">{$list.id}</td>
                                <td align="center">{$list.cn_name}</td>
                                <td align="center">{$list.name}</td>
                                <td align="center"><a href="{$site_url}admin/privilege/list/{$list.double_parent_id}">{$list.parent_name}</a></td>
                                <td align="center"><a href="{$site_url}admin/privilege/edit/{$list.id}">修改</a> 
                                    | <a href="javascript:void(0);" class="delete" title="{$list.cn_name}" id="{$list.id}">删除</a> 
                                 {if $list.has_child !=0}| <a href="{$site_url}admin/privilege/list/{$list.id}">下级分类</a>{/if} {if $list.parent_id == 0} | <a href="{$site_url}admin/privilege/createfile/{$list.id}">生成分类文件</a>{/if}</td>
                            </tr>  
                            {/foreach}
                        </tbody>
                    </table>
                 
                </div>
            </form>
        </div>
        <script>
            $(function(){
                $('.delete').click(function(){
                    var title = $(this).attr('title');
                    var id = $(this).attr('id');
                    $.dialog.confirm('你确定要删除<font color=red>'+title+'</font>吗？', function(){
                        location.href="{$site_url}admin/privilege/delete/"+id;
                    }, function(){
                    });
                   
                });
            });
        </script>
    </body>
</html>